package com.twu.biblioteca.movie;

import com.twu.biblioteca.item.ItemDAO;

import java.util.HashMap;
import java.util.Map;

/**
 * Created by Enrico on 16/09/2014.
 */
public class MovieDAOFactory {

    private MovieDAOFactory() {
    }

    private static final int FILE_DATA = 1;
    private static final int DATABASE = 2;
    private static final int DEFAULT = FILE_DATA;

    public static ItemDAO build() {
        return build(DEFAULT);
    }

    private static ItemDAO build(int impl) {
        Map<Integer, ItemDAO> factory = new HashMap<Integer, ItemDAO>();

        factory.put(FILE_DATA, new MovieDAOFileImpl());

        return factory.get(impl);
    }
}
